package com.xuxueli.crawler.test.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Timestamp;

@Entity
public class Cart {
    private String id;
    private Long userId;
    private Long productId;
    private Long quantity;
    private Timestamp createTime;
    private Timestamp updateTime;
    private String cartHtrf;
    private String cartname;
    private String price;
    private String itemean;

    @Id
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "USER_ID")
    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "PRODUCT_ID")
    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    @Basic
    @Column(name = "QUANTITY")
    public Long getQuantity() {
        return quantity;
    }

    public void setQuantity(Long quantity) {
        this.quantity = quantity;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "UPDATE_TIME")
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "CART_HTRF")
    public String getCartHtrf() {
        return cartHtrf;
    }

    public void setCartHtrf(String cartHtrf) {
        this.cartHtrf = cartHtrf;
    }

    @Basic
    @Column(name = "CARTNAME")
    public String getCartname() {
        return cartname;
    }

    public void setCartname(String cartname) {
        this.cartname = cartname;
    }

    @Basic
    @Column(name = "PRICE")
    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    @Basic
    @Column(name = "ITEMEAN")
    public String getItemean() {
        return itemean;
    }

    public void setItemean(String itemean) {
        this.itemean = itemean;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Cart cart = (Cart) o;

        if (id != null ? !id.equals(cart.id) : cart.id != null) return false;
        if (userId != null ? !userId.equals(cart.userId) : cart.userId != null) return false;
        if (productId != null ? !productId.equals(cart.productId) : cart.productId != null) return false;
        if (quantity != null ? !quantity.equals(cart.quantity) : cart.quantity != null) return false;
        if (createTime != null ? !createTime.equals(cart.createTime) : cart.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(cart.updateTime) : cart.updateTime != null) return false;
        if (cartHtrf != null ? !cartHtrf.equals(cart.cartHtrf) : cart.cartHtrf != null) return false;
        if (cartname != null ? !cartname.equals(cart.cartname) : cart.cartname != null) return false;
        if (price != null ? !price.equals(cart.price) : cart.price != null) return false;
        if (itemean != null ? !itemean.equals(cart.itemean) : cart.itemean != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (productId != null ? productId.hashCode() : 0);
        result = 31 * result + (quantity != null ? quantity.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (cartHtrf != null ? cartHtrf.hashCode() : 0);
        result = 31 * result + (cartname != null ? cartname.hashCode() : 0);
        result = 31 * result + (price != null ? price.hashCode() : 0);
        result = 31 * result + (itemean != null ? itemean.hashCode() : 0);
        return result;
    }
}
